package sjp.learn.designpattern.factory.simplefactory;

public class CourseFactory {
    public ICourse create(Class clazz) {
        if (clazz != null) {
            try {
                ICourse course = (ICourse) (clazz.newInstance());
                return course;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return null;
    }
}
